import {BaseConfig, FieldConfig, OptionItem} from "@/fields/config";

export class SelectConfig extends BaseConfig {
  title = "下拉框";
}

const fieldType = "select";

export const selectDefine = {
  name:"下拉框",
  icon:"el-icon-caret-bottom",
  type: fieldType,
  create: () => {
    const config = new SelectConfig();
    for (let i = 1; i < 4; i++) {
      config.optionList.push(new OptionItem("选项" + i));
    }
    return new FieldConfig(fieldType, config);
  },
  design: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/designer/select/index"),
  config: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/config/select/index")
}
